<template>
  <AppTitle title="订单编辑"></AppTitle>
  <el-form :model="form" label-width="auto" style="max-width: 600px">
    <el-form-item label="订单号">
      <el-input v-model="form.orderNo" />
    </el-form-item>
    <el-form-item label="下单时间">
      <el-input v-model="form.orderTime" />
    </el-form-item>
    <el-form-item label="手机号">
      <el-input v-model="form.phone" />
    </el-form-item>
    <el-form-item label="收货人">
      <el-input v-model="form.consignee" />
    </el-form-item>
    <el-form-item label="配送地址">
      <el-input v-model="form.deliverAddress" />
    </el-form-item>
    <el-form-item label="配送时间">
      <el-input v-model="form.deliveryTime" />
    </el-form-item>
    <el-form-item label="用户备注">
      <el-input v-model="form.remarks" />
    </el-form-item>
    <el-form-item label="订单金额">
      <el-input v-model="form.orderAmount" />
    </el-form-item>
    <el-form-item label="订单状态">
      <el-select v-model="form.orderState" placeholder="订单状态">
          <el-option label="已完成" value="已完成" />
          <el-option label="已受理" value="已受理" />
          <el-option label="派送中" value="派送中" />
        </el-select>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">提交</el-button>
      <el-button @click="$router.go(-1)">取消</el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>

import AppTitle from '../../components/AppTitle.vue';
import {ref,reactive} from "vue";
import {orderEdit} from "@/api/order";
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router";
const form = ref(0)
form.value =JSON.parse(sessionStorage.getItem("editInfo"));
console.log(form.value);
const onSubmit = async () => {
  let res = await orderEdit(form.value)
  console.log(res);
  if(res.code == 0){
    ElMessage.success(res.msg)
  }else{
    ElMessage.error(res.msg)
  }
}
</script>

<style lang="scss" scoped>
.el-form{
  padding: 15px;
}
</style>